package com.li.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.li.util.PageUtils;
import com.li.util.Query;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.li.mapper.DeptMapper;
import com.li.pojo.Dept;
import com.li.service.DeptService;
@Service
public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements DeptService{


    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String name = (String)params.get("name");
        params.put("limit","2");
        IPage<Dept> page = this.page(
                new Query<Dept>().getPage(params),
                new QueryWrapper<Dept>().like(StringUtils.isNotBlank(name),"bname", name));
        return new PageUtils(page);
    }
}
